package com.oozol.lieluyun.entity;

import java.util.List;

public class PageBean<T> {
   private Integer currentPage = 1;
   private Integer pageSize = 10;
   private Integer totalNum;
   private Integer isMore;
   private Integer totalPage;
   private Integer startIndex;
   private List<T> items;

   public PageBean() {
   }

   public PageBean(Integer currentPage, Integer pageSize, Integer totalNum) {
      this.currentPage = currentPage;
      this.pageSize = pageSize;
      this.totalNum = totalNum;
      this.totalPage = (this.totalNum + this.pageSize - 1) / this.pageSize;
      this.startIndex = (this.currentPage - 1) * this.pageSize;
      this.isMore = this.currentPage >= this.totalPage ? 0 : 1;
   }

   public Integer getCurrentPage() {
      return this.currentPage;
   }

   public void setCurrentPage(Integer currentPage) {
      this.currentPage = currentPage;
   }

   public Integer getPageSize() {
      return this.pageSize;
   }

   public void setPageSize(Integer pageSize) {
      this.pageSize = pageSize;
   }

   public Integer getTotalNum() {
      return this.totalNum;
   }

   public void setTotalNum(Integer totalNum) {
      this.totalNum = totalNum;
   }

   public Integer getIsMore() {
      return this.isMore;
   }

   public void setIsMore(Integer isMore) {
      this.isMore = isMore;
   }

   public Integer getTotalPage() {
      return this.totalPage;
   }

   public void setTotalPage(Integer totalPage) {
      this.totalPage = totalPage;
   }

   public Integer getStartIndex() {
      return this.startIndex;
   }

   public void setStartIndex(Integer startIndex) {
      this.startIndex = startIndex;
   }

   public List<T> getItems() {
      return this.items;
   }

   public void setItems(List<T> items) {
      this.items = items;
   }
}
